﻿using Caliburn.Micro;
using JY.Wpf.Core.Enums;
using JY.Wpf.Core.Events;
using JY.Wpf.Core.ViewModelBases;
using JY.Wpf.Test.Views.ControlDemoViews;
using SD.IOC.Core.Mediators;

namespace JY.Wpf.Test.ViewModels.ControlDemoViewModels
{
    public class SearchDemoViewModel : ViewModelBase
    {
        #region # 变量

        #endregion

        #region # 构造器
        /// <summary>
        /// 构造器
        /// </summary>
        public SearchDemoViewModel()
        {
        }
        #endregion

        #region # 属性

        #endregion

        #region # Command方法

        public void Search(string keywords)
        {
            this.EventAggregator.PublishOnUIThread(new MessageEvent(keywords,MessageType.Info));
        }

        #endregion

        #region # 方法

        #endregion

        #region # 获取页面 —— object GetView(object context = null)
        /// <summary>
        /// 获取页面
        /// </summary>
        /// <param name="context">页面</param>
        /// <returns></returns>
        public override object GetView(object context = null)
        {
            return ResolveMediator.Resolve<SearchDemoView>();
        }
        #endregion
    }
}
